Few-Shot Learning for Rooftop Detection in Satellite Imagery

Deep Learning Tutorial

Giorgio Coppala, Nadine Daum, Elena Dreyer, Nico Reichardt

Problem Setting

  • Cities need accurate rooftop maps to plan and scale solar PV installations

  • Manual rooftop labeling is slow and costly

  • Every city looks different → traditional models do not generalize well

Idea:

  • Few-shot learning makes segmentation possible with only a handful of labeled examples

Dataset: Rooftops of Geneva

  • Satellite Images: High-resolution RGB satellite images of Geneva available on Huggingface
  • Size: 1,050 labeled image-mask pairs
  • Task: Binary segmentation masks (rooftop vs background)
  • Geographic splits: 3 grids/ neighborhoods (North, Center, South)
  • Image size: 250x250 pixels
  • Categories: Industrial, Residential

Few Shot Learning in General

tbd

Prototypical Network

(modified from) SRPNet

  • high-level schematic (support → prototype → similarity → segmentation)
  • 1-way-1-shot → explain what it means
  • Data preprocessing (augmentation, geographic splits)
  • Model architecture (feature extraction, CNN layers, backbone)
  • Training strategy
    • Loss function
    • Evaluation metrics

(Preliminary) Results

  • Show performance for 1-shot / 5-shot / full-data comparison

  • Show predicted masks

Discussion

Room for improvement:

  • Fine-tune / tweak model parameters
    • Add regularization
    • Increase number of epochs
  • Implement rough approximation of solar potential
    • e.g. based on IoU over roof area

Open for discussion:

  • Try a different encoder ?
    • e.g. ResNet-50
  • Change train / test split strategy ?
    • e.g. random shuffle regardless of geographic regions

GitHub Repo

References

  • Alsentzer, E., Li, M. M., Kobren, S. N., Noori, A., Undiagnosed Diseases Network, Kohane, I. S., & Zitnik, M. (2025). Few shot learning for phenotype-driven diagnosis of patients with rare genetic diseases. npj Digital Medicine, 8(1), 380. https://doi.org/10.1038/s41746-025-01749-1

  • Castello, R., Walch, A., Attias, R., Cadei, R., Jiang, S., & Scartezzini, J.-L. (2021). Quantification of the suitable rooftop area for solar panel installation from overhead imagery using convolutional neural networks. Journal of Physics: Conference Series, 2042(1), 012002. https://doi.org/10.1088/1742-6596/2042/1/012002

  • Chen, Y., Wei, C., Wang, D., Ji, C., & Li, B. (2022). Semi-supervised contrastive learning for few-shot segmentation of remote sensing images. Remote Sensing, 14(17), 4254. https://doi.org/10.3390/rs14174254

  • Ding, H., Zhang, H., & Jiang, X. (2022). Self-regularized prototypical network for few-shot semantic segmentation. Pattern Recognition, 132, 109018. https://doi.org/10.1016/j.patcog.2022.109018

  • Finn, C., Abbeel, P., & Levine, S. (2017). Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning (pp. 1126–1135). https://doi.org/10.48550/arXiv.1703.03400

  • Ge, Z., Fan, X., Zhang, J., & Jin, S. (2025). SegPPD-FS: Segmenting plant pests and diseases in the wild using few-shot learning. Plant Phenomics, 100121. https://doi.org/10.1016/j.plaphe.2025.100121

  • Hu, Y., Liu, C., Li, Z., Xu, J., Han, Z., & Guo, J. (2022). Few-shot building footprint shape classification with relation network. ISPRS International Journal of Geo-Information, 11(5), 311. https://doi.org/10.3390/ijgi11050311

  • Jadon, S. (2021). COVID-19 detection from scarce chest X-ray image data using few-shot deep learning. In Medical Imaging 2021 (pp. 161–170). https://doi.org/10.1117/12.2581496

  • Lee, G. Y., Dam, T., Ferdaus, M. M., Poenar, D. P., & Duong, V. (2025). Enhancing Few-Shot Classification of Benchmark and Disaster Imagery with ATTBHFA-Net. arXiv preprint arXiv:2510.18326. https://doi.org/10.48550/arXiv.2510.18326

  • Li, X., He, Z., Zhang, L., Guo, S., Hu, B., & Guo, K. (2025). CDCNet: Cross-domain few-shot learning with adaptive representation enhancement. Pattern Recognition, 162, 111382. https://doi.org/10.1016/j.patcog.2025.111382

  • Puthumanaillam, G., & Verma, U. (2023). Texture based prototypical network for few-shot semantic segmentation of forest cover: Generalizing for different geographical regions. Neurocomputing, 538, 126201. https://doi.org/10.1016/j.neucom.2023.03.062

  • Snell, J., Swersky, K., & Zemel, R. (2017). Prototypical networks for few-shot learning. Advances in Neural Information Processing Systems, 30. https://doi.org/10.48550/arXiv.1703.05175

  • Sung, F., Yang, Y., Zhang, L., Xiang, T., Torr, P. H., & Hospedales, T. M. (2018). Learning to compare: Relation network for few-shot learning. In CVPR (pp. 1199–1208). https://doi.org/10.1109/CVPR.2018.00131